package com.xbongbong.saas.constant;

import com.xbongbong.saas.enums.SelectProductEnum;
import com.xbongbong.saas.enums.XbbRefTypeEnum;

import java.util.Arrays;
import java.util.List;

/**
 * 产品常量
 *
 * @author feng.zheng
 * @version v1.0
 * @date 2019/10/14 9:40
 * @since v1.0
 */
public class ProductConstant {

    /**
     * 多规格详情
     */
    public static final String MUTIL_SPEC_DETAILS = "specDetails";

    /**
     * 规格类型
     */
    public static final String SPEC_TYPE = "specType";

    /**
     * 子产品id
     */
    public static final String CHILD_PRODUCT_ID = "childProductId";

    /**
     * 产品条码
     */
    public static final String PRODUCT_CODE = "productCode";

    /**
     * 规格条码
     */
    public static final String SPEC_CODE = "specCode";

    /**
     * sku图片
     */
    public static final String PRODUCT_IMAGE = "productImage";

    /**
     * 规格值
     */
    public static final String SPEC_VALUE = "specValue";

    /**
     * 全部库存
     */
    public static final String ALL_STOCK = "allStock";


    /**
     * 启用
     */
    public static final String ENABLE = "enable";

    /**
     * 多规格
     */
    public static final String ADVANCED_MODE = "advancedMode";

    /**
     * 多单位价格解释
     */
    public static final String PRICE_EXPLAINS = "priceexplains";

    /**
     * 单规格值
     */
    public static final String SINGLE_SPEC = "singleSpec";

    /**
     * 单规格值
     */
    public static final String UPDATE_COST = "updateCost";
    /**
     * 单规格值
     */
    public static final String COLSE_JXC = "colseJXC";

    /**
     * 父产品ID
     */
    public static final String PARENT_ID = "parentId";

    /**
     * 全仓id
     */
    public static final Long ALL_WAREHOUSE_ID = 0L;

    /**
     * 全仓名称
     */
    public static final String ALL_WAREHOUSE_NAME = "constant.product.all_warehouse_name";

    /**
     * 含有选择产品的业务
     */
    public static final List<Integer> HAS_SELECT_PRODUCT = Arrays.asList(
            // CRM
            XbbRefTypeEnum.SALES_OPPORTUNITY.getCode(), XbbRefTypeEnum.QUOTATION.getCode(), XbbRefTypeEnum.CONTRACT.getCode(), XbbRefTypeEnum.REFUND.getCode(),
            // 进销存
            XbbRefTypeEnum.SUPPLIER.getCode(), XbbRefTypeEnum.PURCHASE.getCode(),
            XbbRefTypeEnum.RETURNED_PURCHASE.getCode(), XbbRefTypeEnum.BOM_BILL.getCode(), XbbRefTypeEnum.PRODUCTION_ORDER.getCode(), XbbRefTypeEnum.ASSEMBLE.getCode(),
            XbbRefTypeEnum.INVENTORY.getCode(), XbbRefTypeEnum.TRANSFER.getCode(),
            XbbRefTypeEnum.PURCHASE_INSTOCK.getCode(), XbbRefTypeEnum.REFUND_INSTOCK.getCode(), XbbRefTypeEnum.OTHER_INSTOCK.getCode(), XbbRefTypeEnum.PRODUCTION_INSTOCK.getCode(),
            XbbRefTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(), XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode(), XbbRefTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode(), XbbRefTypeEnum.OTHER_OUTSTOCK.getCode(),
            XbbRefTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), XbbRefTypeEnum.WORK_ORDER_OUTSTOCK.getCode(),
            // 工单
            XbbRefTypeEnum.WORK_ORDER.getCode(),
            XbbRefTypeEnum.WORK_ORDER_V2.getCode(),
            XbbRefTypeEnum.RECEIPT_ORDER.getCode()
    );
    /**
     * 含有批次的业务
     */
    public static final List<Integer> HAS_BATCH_PRODUCT = Arrays.asList(
            XbbRefTypeEnum.RETURNED_PURCHASE.getCode(),XbbRefTypeEnum.ASSEMBLE.getCode(),XbbRefTypeEnum.REFUND.getCode(),
            XbbRefTypeEnum.INVENTORY.getCode(), XbbRefTypeEnum.TRANSFER.getCode(),
            XbbRefTypeEnum.PURCHASE_INSTOCK.getCode(), XbbRefTypeEnum.REFUND_INSTOCK.getCode(), XbbRefTypeEnum.OTHER_INSTOCK.getCode(), XbbRefTypeEnum.PRODUCTION_INSTOCK.getCode(),
            XbbRefTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(), XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode(), XbbRefTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode(), XbbRefTypeEnum.OTHER_OUTSTOCK.getCode(),
            XbbRefTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), XbbRefTypeEnum.WORK_ORDER_OUTSTOCK.getCode(), XbbRefTypeEnum.PRODUCT.getCode()
    );

    /**
     * 没有打印模板的业务别名
     */
    public static final List<String> NO_PRINT_TEMPLATE = Arrays.asList(
            XbbRefTypeEnum.WAREHOUSE.getAlias(),XbbRefTypeEnum.BATCH_FLOW_BILL.getAlias(),XbbRefTypeEnum.STOCK_FLOW_BILL.getAlias(),
            XbbRefTypeEnum.SEQ_SEARCH.getAlias(),XbbRefTypeEnum.STOCK_STANDING_BOOK.getAlias()
    );
    /**
     * 是否开启序列号
     */
    public static final String SERIAL = "serial";

    public static final String SEQ = "seq";

    /**
     * 批次保质期 序列号 标识
     */
    public static final String Enable_Batch_Shelf_Life = "enableBatchShelfLife";
    public static final String Enable_Serial_Number = "enableSerialNumber";
    public static final String Shelf_Life_Days = "shelfLifeDays";
    public static final String Enable_Multi_Unit = "enableMultiUnit";

    public static final String UNIT_RATE = "unitRate";

    public static final String TRANSFORM_UNIT_RATE = "transformUnitRate";


    /**
     * 多单位需要展示辅助单位业务
     */
    public static final List<Integer> MULIT_UNIT_TYPE = Arrays.asList(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode(), XbbRefTypeEnum.QUOTATION.getCode(), XbbRefTypeEnum.CONTRACT.getCode(), XbbRefTypeEnum.PURCHASE.getCode(),
            XbbRefTypeEnum.REFUND.getCode(), XbbRefTypeEnum.RETURNED_PURCHASE.getCode(), XbbRefTypeEnum.WORK_ORDER.getCode(), XbbRefTypeEnum.PRODUCTION_ORDER.getCode(), XbbRefTypeEnum.ASSEMBLE.getCode(),
            XbbRefTypeEnum.OTHER_INSTOCK.getCode(), XbbRefTypeEnum.OTHER_OUTSTOCK.getCode(), XbbRefTypeEnum.PURCHASE_INSTOCK.getCode(), XbbRefTypeEnum.REFUND_INSTOCK.getCode(), XbbRefTypeEnum.PRODUCTION_INSTOCK.getCode(),
            XbbRefTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(), XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode(), XbbRefTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode(), XbbRefTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(),
            XbbRefTypeEnum.WORK_ORDER_OUTSTOCK.getCode(), XbbRefTypeEnum.INVENTORY.getCode(), XbbRefTypeEnum.TRANSFER.getCode(), XbbRefTypeEnum.ORI_STOCK.getCode(),XbbRefTypeEnum.WORK_ORDER_V2.getCode());

    public static final String PRICE = "price";

    public static final String PRODUCT_PRICE = "productPrice";

    public static final Long MAX_SINGLE_UNIT_VALUE = 1000L;

    public static final String SELLING_PRICE_MAP = "sellingPriceMap";

    public static final String HAS_CHANGED_UNIT = "hasChangedUnit";

    public static final String PRICE_DATA = "priceData";

    public static final List<String> MULTI_PRICE_ATTR_LIST = Arrays.asList(SelectProductEnum.PRICE.getAttr(),SelectProductEnum.COST.getAttr(),SelectProductEnum.SELLING_PRICE.getAttr(),SelectProductEnum.UNIT.getAttr());

    /**
     * 多单位没有强关联业务
     */
    public static final List<Integer> NO_LINK_BUSINESS_TYPE_LIST = Arrays.asList(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode(),XbbRefTypeEnum.QUOTATION.getCode(), XbbRefTypeEnum.CONTRACT.getCode(), XbbRefTypeEnum.PRODUCTION_ORDER.getCode(),
            XbbRefTypeEnum.WORK_ORDER.getCode(), XbbRefTypeEnum.PURCHASE.getCode());

    // 影响单位成本库存的单据
    public static final List<Integer> EFFECT_PRODUCT_COST = Arrays.asList(XbbRefTypeEnum.TRANSFER.getCode(),XbbRefTypeEnum.INVENTORY.getCode(), XbbRefTypeEnum.ORI_STOCK.getCode(), XbbRefTypeEnum.OTHER_INSTOCK.getCode(),
            XbbRefTypeEnum.PURCHASE_INSTOCK.getCode(), XbbRefTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(), XbbRefTypeEnum.PRODUCTION_INSTOCK.getCode(), XbbRefTypeEnum.REFUND_INSTOCK.getCode()
            , XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode(), XbbRefTypeEnum.ORDER_OUTSTOCK.getCode(), XbbRefTypeEnum.OTHER_OUTSTOCK.getCode(), XbbRefTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode()
            , XbbRefTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), XbbRefTypeEnum.WORK_ORDER_OUTSTOCK.getCode(), XbbRefTypeEnum.ASSEMBLE.getCode());

    // 影响单位成本库存的单据
    public static final List<Integer> EFFECT_PRODUCT_COST_AND_STOCK = Arrays.asList(XbbRefTypeEnum.TRANSFER.getCode(),XbbRefTypeEnum.INVENTORY.getCode(), XbbRefTypeEnum.ORI_STOCK.getCode(), XbbRefTypeEnum.OTHER_INSTOCK.getCode(),
            XbbRefTypeEnum.PURCHASE_INSTOCK.getCode(), XbbRefTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(), XbbRefTypeEnum.PRODUCTION_INSTOCK.getCode(), XbbRefTypeEnum.REFUND_INSTOCK.getCode()
            , XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode(), XbbRefTypeEnum.ORDER_OUTSTOCK.getCode(), XbbRefTypeEnum.OTHER_OUTSTOCK.getCode(), XbbRefTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode()
            , XbbRefTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), XbbRefTypeEnum.WORK_ORDER_OUTSTOCK.getCode(), XbbRefTypeEnum.ASSEMBLE.getCode(),XbbRefTypeEnum.COST_ADJUST.getCode());

    // 出库单据
    public static final List<Integer> OUTSTOCK_TYPE_LIST = Arrays.asList(XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode(), XbbRefTypeEnum.ORDER_OUTSTOCK.getCode(), XbbRefTypeEnum.OTHER_OUTSTOCK.getCode(), XbbRefTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode()
            , XbbRefTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), XbbRefTypeEnum.WORK_ORDER_OUTSTOCK.getCode());
}
